package com.swf.common.fmt;

import java.io.*;

import org.dom4j.*;

import com.swf.common.utils.*;
import com.swf.common.xml.*;

public class XmlHead {
	private String version;
	private String encoding;
	public String getVersion() {
		return version;
	}
	public void setVersion(String version) {
		this.version = version;
	}
	public String getEncoding() {
		return encoding;
	}
	public void setEncoding(String encoding) {
		this.encoding = encoding;
	}
	
	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("<xmlHead version=\""+this.version+"\" encoding=\""+this.encoding+"\"/>");
		return sb.toString();
	}
	public String toFormatString() {
		try {
			return FwsXmlUtils.formatPrettyXmlWithOutEncoding(toString());
		} catch (DocumentException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}
}
